export const editAction = (payload) => {
  return { type: 'edit', payload };
};

//  enf
export const delAction = (payload) => {
  return { type: 'del', payload };
};

export const addAction = (payload) => {
  // reducer 希望数据是可预测的，那么把id生成放在 reducer之前完成比较好
  const obj = { id: +new Date(), name: payload, done: false };
  return { type: 'add', payload: obj };
};

export const changeAllAction = (payload) => {
  return { type: 'changeAll', payload };
};
